<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
    <script>
        setInterval(show,1000)
      function show(){
        var app = document.getElementById("app")
        var date = new Date();
        var hours = date.getHours();
        var minutes = date.getMinutes();
        var seconds = date.getSeconds();
        var sum = handleNum(hours)+":"+handleNum(minutes)+":"+handleNum(seconds)
        console.log(sum);
        app.innerHTML = sum;
        
      }
        function handleNum(num){
            if(num<10){
                num = "0"+num;
            }
            return num;
        }
    </script>
</body>
</html>